# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=btrfs-compsize
_pkgname=compsize
pkgver=1.3
pkgrel=0
pkgdesc="Calculate compression ratio of a set of files on Btrfs"
url="https://github.com/kilobyte/compsize"
arch="all"
license="GPL-2.0-or-later"
makedepends="btrfs-progs-dev"
options="!check" # no test suite
subpackages="$pkgname-doc"
source="$_pkgname-$pkgver.tar.gz::https://github.com/kilobyte/compsize/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	make
}

package() {
	install -d "$pkgdir"/usr/share/man/man8
	make PREFIX="$pkgdir" install

	# compsize requires root privileges
	install -d "$pkgdir"/usr/sbin
	mv "$pkgdir"/usr/bin/compsize "$pkgdir"/usr/sbin
}

sha512sums="411b92651fdc3d03deccbf38f72936fee95cf80c67d6368efbc0dafacfe9793815a23ef0d02f7feadf31391e415df3d90cd19fb3acc8cce94f37cb3e4eed623d  compsize-1.3.tar.gz"
